﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Heavy_Metals
{
    public partial class LYXX_YACSYHL : Form
    {
        public LYXX_YACSYHL()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.dataGridView1.Rows.Clear();
            this.dataGridView1.Rows.Add("z松花江朱顺屯河段", "宽河段区域", "朱顺屯，建于1933年", "XXXXXXXXXXXXXXXX", "平原", "XX", "查看与修改", "删除");
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "";
        }

        private void LYXX_YACSYHL_Load(object sender, EventArgs e)
        {
            DataGridViewLinkColumn lc = new DataGridViewLinkColumn();
            lc.HeaderText = "删除";
            lc.Name = "删除";
            lc.Width = 60;
            DataGridViewLinkColumn lc1 = new DataGridViewLinkColumn();
            lc1.HeaderText = "查看与修改";
            lc1.Name = "查看与修改";
            lc1.Width = 60;
            this.dataGridView1.Columns.Add("流域名称", "流域名称");
            this.dataGridView1.Columns.Add("流域概况信息", "流域概况信息");
            this.dataGridView1.Columns.Add("沿岸城市信息", "沿岸城市信息");
            this.dataGridView1.Columns.Add("河流功能分区信息", "河流功能分区信息");
            this.dataGridView1.Columns.Add("污染源与排污口地理位置信息", "污染源与排污口地理位置信息");
            this.dataGridView1.Columns.Add("自动检测断面信息", "自动检测断面信息");
            this.dataGridView1.Columns.Add(lc1);
            this.dataGridView1.Columns.Add(lc);
            this.dataGridView1.Rows.Add("z松花江朱顺屯河段", "宽河段区域", "朱顺屯，建于1933年", "XXXXXXXXXXXXXXXX", "平原", "XX", "查看与修改", "删除");
            this.dataGridView1.Rows.Add("岘港", "高流速河段", "33", "44", "55", "66", "查看与修改", "删除");
            this.dataGridView1.Rows.Add("111", "222", "333", "444", "555", "666", "查看与修改", "删除");
        }

        private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != -1)
            {
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "删除")
                {
                    this.dataGridView1.Rows.RemoveAt(e.RowIndex);
                }
                if (this.dataGridView1.Columns[e.ColumnIndex].Name == "查看与修改")
                {
                    LYXX_YACSYHL_CKXG ckxg = new LYXX_YACSYHL_CKXG();
                    ckxg.Show();
                }
            }
        }
    }
}
